Fix Non-Admin Add GH Org button for org selector #103127
Merged
+38
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the recent change of updating the org selector's link button to match the integration settings page's GH app installation button (#102680). The most recent change used inner components of the IntegrationButton component in order to use the integration settings "Add installation" button and modified the styling to be the clear button designated in the Figma. However, for non-admins who did not have access, clicking on the button would just pop out the new window and redirect back to the prevent/tests page with a error toast (if they were already GH authenticated) since they wouldn't have proper permissions.
Ex of undesired behavior:

With this change, we are just using the whole IntegrationButton which handles switching between the "Add" button for admins and the "Request" button for non-admins. I've talked to Adalene and we agreed that we are fine with changing the styling to primary button styling for both.
Admin:

Non-admin:
